<form id="form-edu" action="/invitation/edu_${behaviour}" method="POST">
    <input type="hidden" name="CSRFToken" value="${CSRFToken!""}"/>
    <input type="hidden" name="mobile" value="${mobile}" />
    <#if resumeEdit??>
    <#--简历编辑页-->
    <table width="100%" class="dj-form-base th-left">
        <colgroup>
            <col width="190">
            <col width="*">
        </colgroup>
    <#else >
    <#--简历创建页-->
    <table width="100%" class="dj-form-smart th-left">
        <colgroup>
            <col width="250">
            <col width="*">
        </colgroup>
    </#if>
    <tbody>
    <tr>
        <th><em>*</em>就读时间:</th>
        <td class="input">
            <input type="text" reg="fun:$.formValidateFn.time,edu,td" class="text year J_checkInput2" id="work-startdate-year" name="start" maxlength="4" value="${(edu.startDate?string('yyyy'))!}">
            <span class="input">年</span>
            <input type="text" class="text month" id="startdate-month" name="start" maxlength="2" value="${(edu.startDate?string('MM'))!}">
            <span class="input">月&nbsp;至</span>
            <input type="text" class="text year" id="enddate-year" name="end" maxlength="4" value="${(edu.endDate?string('yyyy'))!""}" <#if checked??>disabled </#if>>
            <span class="input">年</span>
            <input type="text" class="text month" id="enddate-month" name="end" maxlength="2" value="${(edu.endDate?string('MM'))!""}" <#if checked??>disabled </#if>>
            <span class="input">月</span>
            <div style="display: none; " class="error">请填写正确的就读时间</div>
        </td>
    </tr>
    <tr>
        <th><em>*</em>学校名称:</th>
        <td class="input matchbox-wrap">
            <div class="matchbox"><div class="clearfix"><input type="text" autocomplete="off" id="schoolName-input" class="text J_checkInput2" name="schoolName" reg="^.{2,20}$" maxlength="20" value="${(edu.schoolName)!}"></div></div>&nbsp;&nbsp;
            <div style="display:none;" class="error">请正确填写学校名称</div>
        </td>
        <script type="text/javascript">
            $('#schoolName-input').matchbox({query: '/ajax/dictli?type=school&s={1}', strict: false});
        </script>
    </tr>
    <tr>
        <th><em>*</em>专业名称:</th>
        <td class="input">
            <input type="text" class="text J_checkInput2" id="majorname-input" name="majorName" reg="^.{2,15}$" maxlength="15" value="${(edu.majorName)!}">
            <div style="display:none;" class="error">请填写专业名称</div>
        </td>
    </tr>
    <#--<tr>
        <th><em>*</em>专业分类:</th>
        <td id="major-linkup" class="input">
        <#assign majorParentId = 0 />
        <#assign majorId = 0 />
        <#if (edu.major)??>
            <#assign majorParentId = (dictMap.DICT_MAJOR.map.get(edu.major).parentId)!0 />
            <#assign majorId = edu.major />
        </#if>
            <select class="form-item-margin J_checkInput2" style="width:120px;" id="specialty-sort-select">
                <option value="">请选择</option>
            <#list dictMap.DICT_MAJOR.data as item>
                <option value="${item.id?c}"<#if majorParentId==item.id || majorId==item.id> selected</#if>>${item.name}</option>
            </#list>
            </select>
            <select name="major" id="edu-major-select" style="width:122px;" class="J_checkInput2">
                <option value="">请选择</option>
            <#if majorId!=0>
                <#if majorParentId != 0>
                    <#list (dictMap.DICT_MAJOR.map.get(majorParentId).children)![] as item>
                        <option value="${item.id?c}"<#if majorId == item.id> selected</#if>>${item.name}</option>
                    </#list>
                <#else>
                    <#if dictMap.DICT_MAJOR.map.get(majorId)??>
                        <option value="${majorId?c}" selected>dictMap.DICT_MAJOR.map.get(majorId).name!}</option>
                    </#if>
                </#if>
            </#if>
            </select>
            <#include '../../common/major_suggest.ftl'/>
            <em class="sync"></em>
            <div style="display: none; " class="error">请选择专业分类</div>
        </td>
    </tr>-->
    <tr>
        <th><em>*</em>学历:</th>
        <td class="input">
            <select name="degree" class="J_checkInput2 public-select"  reg="^[^0]">
                <option value="">请选择</option>
                <#list dictMap.DICT_DEGREE.data as item>
                    <option value="${item.id?c}"<#if (edu.degree)?? && edu.degree==item.id>selected</#if>>${item.name}</option>
                </#list>
            </select>
            <div style="display: none; " class="error">请选择学历</div>
        </td>
    </tr>
    <#--<tr>
        <th>学位:</th>
        <td>
            <select   name="graduate" class="public-select">
                <option value="">请选择</option>
                <#list dictMap.DICT_DIPLOMA.data as item>
                    <option value="${item.id?c}" <#if (edu.graduate)?? && edu.graduate==item.id>selected</#if>>${item.name}</option>
                </#list>
            </select>
        </td>
    </tr>

    <tr>
        <th>GPA:</th>
        <td class="input">
            <input type="text" name="gpa" value="${gpaStr!""}" reg="fun:_GapCheck" maxlength="4" blankSubmit="true" class="text J_checkInput2">
            <div style="display: none; " class="error">请输入正确的GPA</div>
        </td>
    </tr>
    <tr>
        <th>班内名次:</th>
        <td>
            <select name="classRank" class="public-select">
                <option value="0">请选择</option>
                <#list dictMap.DICT_CLASS_RANK.data as item>
                    <option value="${item.id?c}"<#if (edu.classRank)?? && edu.classRank==item.id>selected</#if>>${item.name}</option>
                </#list>
            </select>
        </td>
    </tr>
    <tr>
        <th style="padding-bottom:10px;" class="label">专业描述:</th>
        <td style="padding-bottom:10px;" class="input textarea-box">
            <textarea name="majorDescr" blanksubmit="true" reg="^.{0,400}$" blankvalue="描述你所学专业的主修课程（限400字）" blankclass="g9"  class="textarea-con J_checkInput2 g9" style="width:373px;height:60px;font-size:12px;" maxnum="400"><#if (edu.majorDescr)??>${edu.majorDescr}</#if></textarea>
            <em class="sync"></em>
            <p class="textarea-check-tip"><span class="J_lastNum g9"><span>0</span>/400</span></p>
        </td>
    </tr>
    <#if isDisplaySyncBtn?? && isDisplaySyncBtn==1>
    <tr>
        <th><em>*</em>复制到档案:</th>
        <td class="input">
            <input class="radio J_checkInput2" type="radio" name="copy" id="yes" value="yes" focuscolor="false">
            <label class="radio" style="padding-right:20px;" for="yes">是</label>
            <input class="radio J_checkInput2" type="radio" name="copy" id="no" value="no" focuscolor="false">
            <label class="radio" style="padding-right:20px;" for="no">否</label>
            <span class="f12 g6 input copy-tip">（让HR更容易发现你，并为你带来更多机会）</span>
            <div style="display: none; " class="error">请选择是否复制到档案中</div>
        </td>
    </tr>
    </#if>-->
    <tr>
        <th>&nbsp;</th>
        <td class="input button">
        <#if resumeEdit??>
        <#--简历编辑页-->
            <a href="javascript:void(0);" class="fresh eduValidate margin" id="J_formSubmit2" itemtype="edu"><span>保存</span></a><a href="javascript:void(0);" class="normal J_cancel" itemtype="edu"><span>取消</span></a>
        <#else >
        <#--简历创建页-->
            <a href="javascript:void(0);" class="big-fresh eduValidate margin" id="J_formSubmit2"><span><#if resumeCreate ?? && resumeCreate>完成<#else >下一步</#if></span></a>
            <#if resumeCreate ?? && resumeCreate>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:void(0)" class="f12 t-color" id="J_formCancel">跳过</a></#if>
        </#if>
        </td>
    </tr>
    </tbody>
</table>
    <input type="hidden" name="method" value="do"/>
    <input type="hidden" id="changeIdentity" name="changeIdentity" value="${(changeIdentity)!""}">
    <input type="hidden" name="startDate" value="" id="id-startDate">
    <input type="hidden" name="endDate" value="" id="id-endDate">
</form>
<script type="text/javascript">
    $(function() {
        var $checks = $('.J_checkInput2 '),
                $btnO = $('#J_formSubmit2'),
                flag = true;
        $checks.formValidate({button:'eduValidate'});
        $checks.focus(function () {
            $(this).parents('td.input').find('.error').hide();
            $(this).removeClass('textarea-error');
        }).click(function(){
                    $(this).parents('td.input').find('.error').hide();
                });
        $('.text').focus(function(){
            $(this).parents('td.input').find('.error').hide();
        });

        $btnO.click(function (e) {
            e.preventDefault();
            var itemType = $(this).attr('itemtype');
            $checks.each(function () {
                var e = $.formValidate.check('eduValidate',this);
                if (!e) {
                    if(this.nodeName == 'TEXTAREA'){
                        $(this).addClass('textarea-error')
                    }
                    $(this).parents('td.input').find('.error').show();
                   $ (this).parents('td.input').find('.queryout').remove();
                }
            });
            if ($.formValidate.check('eduValidate')) {
                var startDate = $('#work-startdate-year').val() + '-';
                if ($('#startdate-month').val().length == 1) {
                    startDate += '0';
                }else if ($('#startdate-month').val().length == 0) {
                    startDate += '01';
                }
                startDate += $('#startdate-month').val() + "-01";
                $('#id-startDate').val(startDate);
                var endDate = $('#enddate-year').val() + '-';
                if ($('#enddate-month').val().length == 1) {
                    endDate += '0';
                }else if ($('#enddate-month').val().length == 0) {
                    endDate += '01';
                }
                endDate += $('#enddate-month').val() + "-01";
                $('#id-endDate').val(endDate);
                $checks.each(function(){
                    var $this = $(this);
                    var bv = $this.attr('blankvalue');
                    if(bv && bv == $this.val()){
                        $this.val('');
                    }
                });
                callback(itemType);
            }
        });
    });


</script>
